<?php
namespace app\admin\controller;
use think\Controller;
use think\Session;
use think\Db;
class Common extends Controller
{


    public function __construct(){
        parent::__construct();

        $user=Session::get('cmuser');
        $where['master']=$user;
        $zu=Db::name('admin')->where($where)->find();
        if(isset($zu['ini'])){
          if($zu['ini']==1){
            $user=$user.'( 管理员 )  ';
          }else{
            $user=$user.'( 会员 )  ';
          }
        }
        $website=website();
        $this->view->assign('website', $website);
        $this->view->assign('config_limit', config_limit);
        $this->view->assign('config_limits', config_limits);
        $this->view->assign('user', $user);
        $this->view->assign('Assets', Assets);
        $this->checklogin();
    }


    public function checklogin(){


//初始化session
session([
    'prefix'     => 'module',
    'type'       => '',
    'auto_start' => true,
]);


      if(!isset($_SESSION['think']['cmuser'])){
          $this->redirect(url('/admin/login/index'));
       }

      
        //dump($website);


    }




}

?>